package cn.zktr.Personnel.model.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the per_tng_xes database table.
 * 
 */
@Entity
@Table(name="per_tng_xes")
@NamedQuery(name="PerTngXes.findAll", query="SELECT p FROM PerTngXes p")
public class PerTngXes implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="PER_TNG_XES_XESID_GENERATOR", sequenceName="SEQ1",allocationSize=1,initialValue=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="PER_TNG_XES_XESID_GENERATOR")
	private int xesid;

	private int xesstat;

	//bi-directional many-to-one association to PerIntention
	@OneToMany(mappedBy="perTngXe")
	private List<PerIntention> perIntentions;

	//bi-directional many-to-one association to PerTngRet
	@OneToMany(mappedBy="perTngXe")
	private List<PerTngRet> perTngRets;

	//bi-directional many-to-one association to PerPmsEmp
	@ManyToOne
	@JoinColumn(name="EMPID")
	private PerPmsEmp perPmsEmp;

	//bi-directional many-to-one association to PerTngPojs
	@ManyToOne
	@JoinColumn(name="POJSID")
	private PerTngPojs perTngPoj;

	public PerTngXes() {
	}

	public int getXesid() {
		return this.xesid;
	}

	public void setXesid(int xesid) {
		this.xesid = xesid;
	}

	public int getXesstat() {
		return this.xesstat;
	}

	public void setXesstat(int xesstat) {
		this.xesstat = xesstat;
	}

	public List<PerIntention> getPerIntentions() {
		return this.perIntentions;
	}

	public void setPerIntentions(List<PerIntention> perIntentions) {
		this.perIntentions = perIntentions;
	}

	public PerIntention addPerIntention(PerIntention perIntention) {
		getPerIntentions().add(perIntention);
		perIntention.setPerTngXe(this);

		return perIntention;
	}

	public PerIntention removePerIntention(PerIntention perIntention) {
		getPerIntentions().remove(perIntention);
		perIntention.setPerTngXe(null);

		return perIntention;
	}

	public List<PerTngRet> getPerTngRets() {
		return this.perTngRets;
	}

	public void setPerTngRets(List<PerTngRet> perTngRets) {
		this.perTngRets = perTngRets;
	}

	public PerTngRet addPerTngRet(PerTngRet perTngRet) {
		getPerTngRets().add(perTngRet);
		perTngRet.setPerTngXe(this);

		return perTngRet;
	}

	public PerTngRet removePerTngRet(PerTngRet perTngRet) {
		getPerTngRets().remove(perTngRet);
		perTngRet.setPerTngXe(null);

		return perTngRet;
	}

	public PerPmsEmp getPerPmsEmp() {
		return this.perPmsEmp;
	}

	public void setPerPmsEmp(PerPmsEmp perPmsEmp) {
		this.perPmsEmp = perPmsEmp;
	}

	public PerTngPojs getPerTngPoj() {
		return this.perTngPoj;
	}

	public void setPerTngPoj(PerTngPojs perTngPoj) {
		this.perTngPoj = perTngPoj;
	}

}